﻿<Window x:Class="KegManager.KegWindow"
        xmlns:my="clr-namespace:KegManager"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"

        Title="KegWindow" Height="198" Width="350" ShowInTaskbar="False" WindowStartupLocation="CenterScreen" ResizeMode="NoResize">
    <Window.Resources>
        <my:PathLabelConverter x:Key="PathLabelConverter" />
        <my:TemperatureConverter x:Key="TemperatureConverter" />
        <my:SmallVolumeConverter x:Key="SmallVolumeConverter" />
        <my:LargeVolumeConverter x:Key="LargeVolumeConverter" />
    </Window.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="30" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        
        <Label Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right">Beer:</Label>
        <ComboBox Grid.Row="0" Grid.Column="1" Grid.ColumnSpan="2" Name="BeerList" Margin="2,2,2,2" ItemsSource="{Binding Beers}" >
            <ComboBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="{Binding Path=Name}" />
                    </StackPanel>
                </DataTemplate>
            </ComboBox.ItemTemplate>
        </ComboBox>
        <Button Grid.Row="0" Grid.Column="3" Name="buttonNewBeer" Margin="2,2,2,2" Click="buttonNewBeer_Click">...</Button>

        <Label Grid.Row="1" Grid.Column="0" HorizontalAlignment="Right">Initial Volume:</Label>
        <TextBox Grid.Row="1" Grid.Column="1" Name="InitialVolume"  Margin="2,2,2,2" Text="{Binding Path=keg.InitialVolume, Mode=TwoWay, Converter={StaticResource LargeVolumeConverter}}"></TextBox>
        
        <Label Grid.Row="2" Grid.Column="0" HorizontalAlignment="Right" IsEnabled="True">Current Volume:</Label>
        <TextBox Grid.Row="2" Grid.Column="1" Name="CurrentVolume"  Margin="2,2,2,2" IsEnabled="True" Text="{Binding Path=keg.CurrentVolume, Mode=TwoWay, Converter={StaticResource LargeVolumeConverter}}"></TextBox>
        <!--<CheckBox Grid.Row="2" Grid.Column="2" Grid.ColumnSpan="2" Margin="2,2,2,2" IsChecked="True" Name="FullKegCheck" VerticalAlignment="Center" Checked="FullKegCheck_Checked" Unchecked="FullKegCheck_Unchecked">Full Keg</CheckBox>-->

        <Label Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right">Filled:</Label>
        <TextBox Grid.Row="3" Grid.Column="1" Name="FilledDate"  Margin="2,2,2,2" Text="{Binding Path=keg.Filled, Mode=TwoWay}"></TextBox>
        
        <Button Grid.Row="4" Grid.Column="1" Name="buttonCancel"  Margin="2,0" Click="buttonCancel_Click">Cancel</Button>
        <Button Grid.Row="4" Grid.Column="2" Name="buttonSave" Margin="2,0" Click="buttonSave_Click">Save</Button>
    </Grid>
</Window>
